﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="GenerateReport.aspx.cs" Inherits="Employee_GenerateReport" %>

<%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">

<p>
   Start Date: <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> 
    <asp:CalendarExtender ID="TextBox1_CalendarExtender" runat="server" 
        Enabled="True" TargetControlID="TextBox1" Format="yyyy/MM/dd" 
        DefaultView="Years">
    </asp:CalendarExtender>
    End Date: <asp:TextBox runat="server" ID="TextBox2"></asp:TextBox> 
   
    <asp:CalendarExtender ID="TextBox2_CalendarExtender" runat="server" 
        Enabled="True" TargetControlID="TextBox2" Format="yyyy/MM/dd" 
        DefaultView="Years">
    </asp:CalendarExtender>
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>
   
    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
        ErrorMessage="Start Date Required" ControlToValidate="TextBox1"></asp:RequiredFieldValidator><br />
    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
        ErrorMessage="Return Date Required" ControlToValidate="TextBox2"></asp:RequiredFieldValidator>
   
</p>
    <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" 
        Font-Size="8pt" InteractiveDeviceInfos="(Collection)" 
        WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" Width="932px">
        <LocalReport ReportPath="Employee\Report1.rdlc" >
            <DataSources>
                <rsweb:ReportDataSource DataSourceId="SqlDataSource1" Name="DataSet1" />
            </DataSources>
        </LocalReport>
    </rsweb:ReportViewer>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:MySqlConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:MySqlConnectionString.ProviderName %>" 
        SelectCommand="SELECT booking_id, first_name, last_name, license_no, plate_no, brand, make, start_date, return_date, tariff, type, cost, total_amout FROM report">
    </asp:SqlDataSource>
    </asp:Content>

